{"componentChunkName":"component---src-templates-blog-template-js","path":"/blogs/react-hooks","result":{"data":{"blog":{"content":"# Advanced Markdown with [David Wells](https://twitter.com/DavidWells)\n\n[Slides -> github.com/DavidWells/advanced-markdown](https://github.com/DavidWells/advanced-markdown/)\n\n## Table of Contents\n<!-- AUTO-GENERATED-CONTENT:START (TOC:collapse=true&collapseText=\"Click to expand\") -->\n<details>\n<summary>\"Click to expand\"</summary>\n\n- [Why markdown?](#why-markdown)\n- [Markdown basics](#markdown-basics)\n- [Advanced Formatting tips](#advanced-formatting-tips)\n  * [`left` alignment](#left-alignment)\n  * [`right` alignment](#right-alignment)\n  * [`center` alignment example](#center-alignment-example)\n  * [`collapse` Sections](#collapse-sections)\n  * [`additional links`](#additional-links)\n  * [Badges](#badges)\n- [Useful packages](#useful-packages)\n- [Useful utilities](#useful-utilities)\n- [How Serverless uses markdown](#how-serverless-uses-markdown)\n  * [DEMO](#demo)\n- [Other Markdown Resources](#other-markdown-resources)\n\n</details>\n<!-- AUTO-GENERATED-CONTENT:END -->\n\n## Why markdown?\n\nMarkdown is a universal doc format that is easy to write and easy to add to a version control system.\n\n- **Open** - Anyone can submit content, fix typos & update anything via pull requests\n- **Version control** - Roll back & see the history of any given post\n- **No CMS lock in** - We can easily port to any static site generator\n- **It's just simple** - No user accounts to manage, no CMS software to upgrade, no plugins to install.\n\n---\n\n## Markdown basics\n\nThe basics of markdown can be found [here](https://guides.github.com/features/mastering-markdown/) & [here](https://daringfireball.net/projects/markdown/). Super easy!\n\n## Advanced Formatting tips\n\n### `left` alignment\n\n<img align=\"left\" width=\"100\" height=\"100\" src=\"http://www.fillmurray.com/100/100\">\n\nThis is the code you need to align images to the left:\n```\n<img align=\"left\" width=\"100\" height=\"100\" src=\"http://www.fillmurray.com/100/100\">\n```\n\n---\n\n### `right` alignment\n\n<img align=\"right\" width=\"100\" height=\"100\" src=\"http://www.fillmurray.com/100/100\">\n\nThis is the code you need to align images to the right:\n```\n<img align=\"right\" width=\"100\" height=\"100\" src=\"http://www.fillmurray.com/100/100\">\n```\n\n---\n\n### `center` alignment example\n\n<p align=\"center\">\n  <img width=\"460\" height=\"300\" src=\"http://www.fillmurray.com/460/300\">\n</p>\n\n```\n<p align=\"center\">\n  <img width=\"460\" height=\"300\" src=\"http://www.fillmurray.com/460/300\">\n</p>\n```\n\n---\n\n### `collapse` Sections\n\nCollapsing large blocks of text can make your markdown much easier to digest\n\n<details>\n<summary>\"Click to expand\"</summary>\nthis is hidden block\n</details>\n\n```\n<details>\n<summary>\"Click to expand\"</summary>\nthis is hidden\n</details>\n```\n\nCollapsing large blocks of Markdown text\n\n<details>\n<summary>To make sure markdown is rendered correctly in the collapsed section...</summary>\n\n 1. Put an **empty line** after the `<summary>` block.\n 2. *Insert your markdown syntax*\n 3. Put an **empty line** before the `</details>` tag\n \n</details>\n\n```\n<details>\n<summary>To make sure markdown is rendered correctly in the collapsed section...</summary>\n\n 1. Put an **empty line** after the `<summary>` block.\n 2. *Insert your markdown syntax*\n 3. Put an **empty line** before the `</details>` tag\n \n</details>\n```\n\n---\n\n### `additional links`\n\n[Website](http://www.serverless.com) • [Email Updates](http://eepurl.com/b8dv4P) • [Gitter](https://gitter.im/serverless/serverless) • [Forum](http://forum.serverless.com) • [Meetups](https://github.com/serverless-meetups/main) • [Twitter](https://twitter.com/goserverless) • [Facebook](https://www.facebook.com/serverless) • [Contact Us](mailto:hello@serverless.com)\n\n```\n[Website](http://www.serverless.com) • [Email Updates](http://eepurl.com/b8dv4P) • [Gitter](https://gitter.im/serverless/serverless) • [Forum](http://forum.serverless.com) • [Meetups](https://github.com/serverless-meetups/main) • [Twitter](https://twitter.com/goserverless) • [Facebook](https://www.facebook.com/serverless) • [Contact Us](mailto:hello@serverless.com)\n```\n\n---\n\n### Badges\n\nI hate them so. Don't use badges.\n\n---\n\n## Useful packages\n\n1. [gray-matter](https://www.npmjs.com/package/gray-matter)\n\n  YAML front-matter is your friend. You can keep metadata in markdown files\n\n  ```\n  title: Serverless Framework Documentation\n  description: \"Great F'in docs!\"\n  menuText: Docs\n  layout: Doc\n  ```\n\n2. [Remark](https://www.npmjs.com/package/remark)\n\n  Useful for rendering markdown in HTML/React\n\n3. [Markdown Magic](https://github.com/DavidWells/markdown-magic)\n\n  - [Repo](https://github.com/DavidWells/markdown-magic)\n  - [Plugins](https://github.com/DavidWells/markdown-magic#plugins)\n  - Show automatic doc generation. [Example 1](https://github.com/DavidWells/markdown-magic/blob/master/examples/generate-readme.js#L15-L23)   | [Example 2](https://github.com/serverless/examples/blob/master/generate-readme.js#L71-L87)\n\n---\n\n## Useful utilities\n\n1. [Schedule Posts](https://github.com/serverless/post-scheduler) - Post scheduler for static sites\n\n  Show DEMO\n\n2. [Zero friction inline content editing](https://jekyll-anon.surge.sh/gods/2015/02/18/vesta.html)\n\n  Show DEMO\n\n3. [Byword](https://bywordapp.com/) & [Typora](https://typora.io/) - Good Editors\n\n4. [Monodraw](https://monodraw.helftone.com/) - Flow charts for days\n\n6. [Kap](https://getkap.co/) - Make gifs\n\n4. [IDE markdown preview](https://atom.io/packages/markdown-preview)\n\n5. Stuck on WordPress? Try [easy-markdown plugin](https://github.com/DavidWells/easy-markdown)\n\n---\n\n## How Serverless uses markdown\n\nServerless.com is comprised of 3 separate repositories\n\n- https://github.com/serverless/blog\n- https://github.com/serverless/serverless | Shoutout to [Phenomic.io](https://phenomic.io/)\n- https://github.com/serverless/site\n\n**Why multiple repos?**\n\n1. We wanted documentation about the framework to live in the serverless github repo for easy access\n2. We wanted our blog content to be easily portable to any static site generator separate from the implementation (site)\n3. `prebuild` npm script pulls the content together & processes them for site build\n\nA single repo is easier to manage but harder for people to find/edit/PR content.\n\n---\n\n### DEMO\n\n- Site structure\n- Serverless build process\n- [Validation](https://github.com/serverless/blog/blob/master/.travis.yml#L10)\n- [Editing Flow](https://serverless.com/framework/docs/providers/aws/cli-reference/deploy/)\n- Github optimizations\n  - [Link from top of each doc to live link on site](https://github.com/serverless/serverless/blob/master/docs/providers/aws/events/schedule.md)\n  - use markdown magic =) to [auto generate tables](https://github.com/serverless/examples) etc\n  - [Hide yaml frontmatter from github folks](https://github.com/serverless/serverless/blame/master/docs/providers/aws/events/schedule.md#L1-L7)\n  - consider linking everything to site\n\n## Other Markdown Resources\n\n- [Verb](https://www.npmjs.com/package/verb) - Documentation generator for GitHub projects\n- [ACSII docs](http://asciidoctor.org/) - Markdown alternative\n","title":"React Hooks","description":"Duis convallis convallis tellus id interdum velit laoreet. Sapien pellentesque habitant morbi tristique. Et odio pellentesque diam volutpat commodo sed egestas egestas fringilla. In ornare quam viverra orci sagittis eu volutpat odio facilisis. Ac felis donec et odio pellentesque diam volutpat commodo sed. Nec tincidunt praesent semper feugiat nibh sed pulvinar proin. Nibh mauris cursus mattis molestie. Varius quam quisque id diam vel. Aliquet nec ullamcorper sit amet."}},"pageContext":{"slug":"react-hooks"}},"staticQueryHashes":["2874580956"]}